<?php
elgg_load_library('elgg:portfolio');

$usr_obj = elgg_get_logged_in_user_entity();
$usr_id = $usr_obj->username;

$default_date = last_working_day(strftime('%Y-%m-%d', time()));
$date_param = get_param_value('date_param', 'holding_date_param', $default_date);
$fund_param = get_param_value('fund_param', 'holding_fund_param', '');
$securities_param = get_param_value('securities_param', 'holding_securities_param', '');

//print_r($securities_param);
//print_r($fund_param);
//print_r($date_param);

$tableArray = portfolio_get_holding($date_param, $usr_id, $fund_param, $securities_param);
echo elgg_view('output/tablesorter', 
	array(
		'value' => $tableArray,
		'tableid' => 'holding',
	)
);
